import QtQuick 2.9
import QtQuick.Window 2.3
import QtQuick.Controls 1.5
import QtQuick.Layouts 1.3
import QtQuick.Controls.Styles 1.4

//          编码规范
//        id
//        属性声明
//        信号声明
//        JavaScript 函数
//        对象属性
//        子对象
//        状态
//        过渡

Window {
    visibility: Window.FullScreen
    title: qsTr("仿制界面")
    Rectangle{
        id:main
        anchors.fill: parent

        color: "black"
        SplitView {
            id: splitView

            anchors.fill: parent
            orientation: Qt.Horizontal

            Rectangle {
                id: leftItem
                width: 200
                Layout.minimumWidth: 200
                color: "#252C36"

                Column{
                    Rectangle{
                        id:search
                        width: leftItem.width
                        height: 20
                        color: "transparent"

                        SearchView{
                            id: searchView
                            Component.onCompleted: {
                                console.debug(searchView.height)
                                console.debug(searchView.width)
                            }
                        }
                    }

                    Rectangle{
                        id:menus

                        width: parent.width
                        height: 20
                        color: "transparent"

                        Row{
                            spacing:2
                            DemoButton {
                                id:button1
                                width: leftItem.width / 4
                                height: 20
                                text: "全部"
                            }

                            DemoButton {
                                id:button2
                                width: leftItem.width / 4
                                height: 20
                                text: "使用中"
                            }
                            DemoButton {
                                id:button3
                                width: leftItem.width / 4
                                height: 20
                                text: "未使用"
                            }
                            DemoButton {
                                id:button4
                                width: leftItem.width / 4
                                height: 20
                                text: "已故障"
                            }

                        }
                    }

                    Rectangle{
                        id:treeViewRectangle
                        width: leftItem.width
                        height: leftItem.height
                        color: "transparent"
                        DemoTreeView
                        {
                            id:treeView
                        }
                    }
                }

                Text {
                    text: "View 1"
                    color: "white"
                    anchors.centerIn: parent
                }
            }

            Rectangle {
                id: centerItem
                width: 200
                Layout.fillWidth: true
                Layout.minimumWidth: 50
                color: "#252C36"
                Text {
                    text: "View 2"
                    color: "white"
                    anchors.centerIn: parent
                }
            }

        }
    }
}
